<template>
	<view style="display: flex; justify-content: space-around;">
		<view class="color-default" style="display: flex;justify-content: center;align-items: center;flex-direction: column;">
				<view v-for="(item,index) in list" @click="uniClick(item)" :style="{background:item.bg}" :key="index" class="box-center  border-radius10 uni-shadow-sm" style="height: 115rpx;width:300rpx;margin: 15rpx; justify-content: space-around;">
					<view><u-icon :name="item.icon" size="50" color="#F9B700"></u-icon></view>
					<view>{{item.name}}</view>
				</view>
		</view>
		<view @click="scan()" class="bg-default color-default f42  border-radius10 uni-shadow-sm" style="height: 260rpx;width: 300rpx; justify-content: center;display: flex; align-items: center;margin-top: 15rpx;">
			<view>
				<view><u-icon  name="scan" color="#47A195" size="42"></u-icon></view>
				<view>扫码</view>
			</view>
		</view>
	</view>
</template>

<script>
	
	export default {
		props: {
			list: {
				type: Array,
			},
		},
		data() {
			return {}
		},
		methods: {
			scan(){
				uni.scanCode({
					success: function (res) {
						console.log(res.path)
						uni.navigateTo({
							url:res.path
						})
					}
				});

			}
		}
	}
</script>

<style>
	.wrap {
		padding: 40rpx;
	}
</style>